﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DevExpress.CrmDemo.Win.Controls
{
    public partial class CommonPage : BasePage
    {
        public CommonPage()
        {
            InitializeComponent();
            this.LoadForm();
        }
        
      
        void LoadForm()
        {

            if (PageStates == States.SystemConfig)
            {
                this.header.Title = "系统设置";

                SystemConfigLeftMenu systemConfigLeftMenu1 = new SystemConfigLeftMenu();
                systemConfigLeftMenu1.Location = new System.Drawing.Point(0, 0);
               // systemConfigLeftMenu1.Dock = DockStyle.Left;
                systemConfigLeftMenu1.Size = new System.Drawing.Size(170, 460);
                this.splitContainer1.Panel1.Controls.Add(systemConfigLeftMenu1);
            }
            else if (PageStates == States.CustomMangager)
            {
                this.header.Title = "客户管理";

                CustomListLeftMenu leftMenu = new CustomListLeftMenu();
                leftMenu.Location = new System.Drawing.Point(0, 0);
                // systemConfigLeftMenu1.Dock = DockStyle.Left;
                leftMenu.Size = new System.Drawing.Size(190, 500);
                this.splitContainer1.Panel1.Controls.Add(leftMenu);
             }
        }

        private void header_BackRequest(object sender, EventArgs e)
        {
            OnNavRequest(new NavRequestEventArgs(States.StartPage));
        }
    }
}
